/*
 * KIMWONSORK@GMAIL.COM
 * COPYRIGHT CRAYONSOFT All rights reserved.
 * 2013오후 9:07:00
 * kws
 */

package com.crayon.account.fragments;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;

import com.crayon.account.dao.DAOAccount;
import com.crayon.account.data.ItemGroup;
import com.crayon.account.fragments.ui.FragmentPieChart.OnPieChartDataBinder;
import com.crayon.sharemenu.R;
import com.crayon.util.UTILDate;
import com.crayon.util.UTILPieChartDemo01View;

import org.afree.chart.AFreeChart;
import org.afree.data.general.PieDataset;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.List;

public class FragmentChildChartDayOfMonth extends FragmentChildChart
implements 
OnClickListener
,OnPieChartDataBinder
{

	public static FragmentChildChartDayOfMonth onCrateInstance(Date time){
		FragmentChildChartDayOfMonth f = new FragmentChildChartDayOfMonth();
		Bundle args =new Bundle();
		args.putLong(PARAM_DATE, time.getTime());
		f.setArguments(args);
		return f;
	}
	


	@Override
	public PieDataset OnPieDataSet() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public AFreeChart createChart(PieDataset dataset) {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public boolean onCreateChartIncom(List<ItemGroup> groups,
			Fragment fragment, int resId) {
		// TODO Auto-generated method stub
		UTILPieChartDemo01View.OnCrateChartByArray(groups,
				String.format("%s %s", getString(R.string.segmenu_write_incom),getString(R.string.segmenu_summary_dayofmonth)),this,resId);

		return false;
	}


	@Override
	public boolean onCreateChartOut(List<ItemGroup> groups, Fragment fragment,
			int resId) {
		// TODO Auto-generated method stub
		UTILPieChartDemo01View.OnCrateChartByArray(groups,
				String.format("%s %s", getString(R.string.segmenu_write_outcom),getString(R.string.segmenu_summary_dayofmonth)),this,resId);

		return false;
	}


	@Override
	public String onCreateChartKey(DAOAccount item) {
		// TODO Auto-generated method stub
		String key = UTILDate.getMMDD(item.getDtStart());
		return !StringUtils.isEmpty(key)? key:getString(R.string.dao_key_nocate);
	}


	@Override
	public boolean onCreateChartSingle(List<ItemGroup> groups,
			Fragment fragment, int resId) {
		// TODO Auto-generated method stub
		return false;
	}



}
